package com.biscuit.page.basicservice.utils;

import com.biscuit.page.basicservice.model.enums.VerifyCodeWorkTypeEnum;

/**
 * @author biscuit
 * @createTime 2024/5/23 14:35
 */
public class VerifyCodeUtil {

    // 基础标识前缀
    private final static String BASE_PREFIX = "tag_$text$:";

    /**
     * 获取一个验证码
     *
     * @return 随机验证码
     */
    public static String getVerifyCode() {
        return NumberUtil.randomNumberByLength(6);
    }

    /**
     * 获取验证码发布次数缓存 key
     */
    public static String getVerifyPublishCountKey(String prefix, String account) {
        return prefix + account + "_publish_count";
    }

    /**
     * 获取验证码缓存 key
     */
    public static String getVerifyCodeKey(String prefix, String account) {
        return prefix + account + "_verify_code";
    }

}
